<?php
namespace app\admin\common\model;


use think\Model;

class Admin extends Model
{
    protected $pk = 'id';
    protected $table = 'qi_admin';

    protected $autoWriteTimestamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    protected $dateFormat = 'Y-m-d H:i:s';


    public function getPageList($pageSize=10)
    {
        $list = Admin::order('id','desc')->paginate($pageSize);
        return $list;
    }

    public function addAdmin($info)
    {
        $info['password'] = md5($info['password']);
        $res = Admin::create($info);
        return $res;
    }

    public function deleteAdmin($id)
    {
        $res = Admin::where('id',$id)->delete();
        return $res;
    }
}